﻿namespace homework10
{
    static class DbHelper
    {
        public static void WriteLogs(string strLog)
        {
            Log log = new Log { Operation = strLog, Timestamp = System.DateTime.Now };
            try
            {
                using (var context = new AppDbContext())
                {
                    context.Logs.Add(log);
                    context.SaveChanges();
                };

                return;
            }
            catch (Exception ex)
            {
                return;
            }
        }
    }
}